# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.Upgrade do
  @moduledoc """
  Describes Private cloud Upgrade.

  ## Attributes

  *   `componentUpgrades` (*type:* `list(GoogleApi.VMwareEngine.V1.Model.VmwareUpgradeComponent.t)`, *default:* `nil`) - Output only. Output Only. The list of component upgrades.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Output Only. Creation time of this resource.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. The description of the upgrade. This is used to provide additional information about the private cloud upgrade, such as the upgrade's purpose, the changes included in the upgrade, or any other relevant information about the upgrade.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Output Only. End time of the upgrade.
  *   `estimatedDuration` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. The estimated total duration of the upgrade. This information can be used to plan or schedule upgrades to minimize disruptions. Please note that the estimated duration is only an estimate. The actual upgrade duration may vary.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - The etag for the upgrade resource. If this is provided on update, it must match the server's etag.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of the private cloud `Upgrade`. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/upgrades/my-upgrade`
  *   `schedule` (*type:* `GoogleApi.VMwareEngine.V1.Model.Schedule.t`, *default:* `nil`) - Schedule details for the upgrade.
  *   `startVersion` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. The start version
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the upgrade.
  *   `targetVersion` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. The target version
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. The type of upgrade.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System-generated unique identifier for the resource.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Output Only. Last update time of this resource.
  *   `version` (*type:* `String.t`, *default:* `nil`) - Output only. 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :componentUpgrades =>
            list(GoogleApi.VMwareEngine.V1.Model.VmwareUpgradeComponent.t()) | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :endTime => DateTime.t() | nil,
          :estimatedDuration => String.t() | nil,
          :etag => String.t() | nil,
          :name => String.t() | nil,
          :schedule => GoogleApi.VMwareEngine.V1.Model.Schedule.t() | nil,
          :startVersion => String.t() | nil,
          :state => String.t() | nil,
          :targetVersion => String.t() | nil,
          :type => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :version => String.t() | nil
        }

  field(:componentUpgrades,
    as: GoogleApi.VMwareEngine.V1.Model.VmwareUpgradeComponent,
    type: :list
  )

  field(:createTime, as: DateTime)
  field(:description)
  field(:endTime, as: DateTime)
  field(:estimatedDuration)
  field(:etag)
  field(:name)
  field(:schedule, as: GoogleApi.VMwareEngine.V1.Model.Schedule)
  field(:startVersion)
  field(:state)
  field(:targetVersion)
  field(:type)
  field(:uid)
  field(:updateTime, as: DateTime)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.Upgrade do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.Upgrade.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.Upgrade do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
